import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/views/index'

Vue.use(Router)
export const routes = [
  {
    path: '/',
    name: 'index',
    component: Index,
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'LoginContainer',
    component: () => import('@/views/Login/index'),
    meta: {icon: 'el-icon-switch-button', title: 'logout', roleType: 1}
  },
  {
    path: '/home',
    name: 'HomeContainer',
    component: () => import('@/views/home/index'),
    redirect: '/home/userManage',
    children: [
      {name: 'userManage', path: '/home/userManage', component: () => import('@/views/System/UserManage'), meta: {icon: 'el-icon-user-solid', title: '用户管理'}},
      {name: 'memo', path: '/home/memo', component: () => import('@/views/Memo/Memo'), meta: {icon: 'el-icon-date', title: '复合查询'}},
      {name: 'chat', path: '/home/buttonGroup', component: () => import('@/views/Button/index'), meta: {icon: 'el-icon-orange', title: '按钮组'}},
      {name: 'file', path: '/home/file', component: () => import('@/views/file/index'), meta: {icon: 'el-icon-upload', title: '分片上传（开发中）'}}
    ]
  }
]

export default new Router({
  mode: 'history',
  routes: routes
})
